﻿' ******************************************************************************
' ** 
' **  Yahoo! Managed
' **  Written by Marius Häusler 2011
' **  It would be pleasant, if you contact me when you are using this code.
' **  Contact: YahooFinanceManaged@gmail.com
' **  Project Home: http://code.google.com/p/yahoo-finance-managed/
' **  
' ******************************************************************************
' **  
' **  Copyright 2011 Marius Häusler
' **  
' **  Licensed under the Apache License, Version 2.0 (the "License");
' **  you may not use this file except in compliance with the License.
' **  You may obtain a copy of the License at
' **  
' **    http://www.apache.org/licenses/LICENSE-2.0
' **  
' **  Unless required by applicable law or agreed to in writing, software
' **  distributed under the License is distributed on an "AS IS" BASIS,
' **  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' **  See the License for the specific language governing permissions and
' **  limitations under the License.
' ** 
' ******************************************************************************


Namespace YahooManaged.Finance.Support

    ''' <summary>
    ''' Stores informations about a country.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class CountryInfo
        Private mID As Country
        Private mName As String = String.Empty
        Private mCurrency As CurrencyInfo = Nothing
        Private mDaylightSavingTimes(-1) As DaylightSavingTime
        Private mIndices As New List(Of Support.YIndexID)

        ''' <summary>
        ''' The country ID.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ID() As Country
            Get
                Return mID
            End Get
        End Property
        ''' <summary>
        ''' The currency of this country
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Currency() As CurrencyInfo
            Get
                Return mCurrency
            End Get
        End Property
        ''' <summary>
        ''' The name of the country
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Name() As String
            Get
                Return mName
            End Get
        End Property
        ''' <summary>
        ''' The list of Daylight Saving Times of the country for each year
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property DaylightSavingTimes() As DaylightSavingTime()
            Get
                Return mDaylightSavingTimes
            End Get
        End Property
        ''' <summary>
        '''The indices of the country
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Indices() As List(Of Support.YIndexID)
            Get
                Return mIndices
            End Get
        End Property

        Public Sub New(ByVal id As Country, ByVal name As String, ByVal cur As CurrencyInfo)
            mID = id
            mName = name
            mCurrency = cur
        End Sub
        Public Sub New(ByVal id As Country, ByVal name As String, ByVal cur As CurrencyInfo, ByVal dstArray() As DaylightSavingTime)
            Me.New(id, name, cur)
            If dstArray IsNot Nothing Then mDaylightSavingTimes = dstArray
        End Sub

        Public Overrides Function ToString() As String
            Return Me.Name
        End Function

    End Class


End Namespace